home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Trusted Irix /B 4.0.4
/
Trusted-Irix B-4.0.1.iso
/
dist
/
eoe1.idb
/
usr
/
include
/
sys
/
mac_label.h.z
/
mac_label.h
Wrap
C/C++ Source or Header
|
1992-04-03
|
6KB
|
142 lines
/**************************************************************************
* *
* Copyright (C) 1988, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
**************************************************************************/
#ifndef __MAC_LABEL_
#define __MAC_LABEL_
#ident "$Header: /src_trees/calypso/att/usr/src/uts/mips/sys/RCS/mac_label.h,v 1.12 91/11/12 13:45:16 pdc Exp $"
/*
* Allow for 26 (A-Z) MSEN label types.
* Expanding this will require a bigger table in mac_dom.c
*/
#define MSEN_MIN_LABEL_NAME 'A' /* No label name less than this */
#define MSEN_MAX_LABEL_NAME 'Z' /* No label name greater than this */
#define MSEN_LABEL_NAME_COUNT 26 /* Number of label types */
#define MSEN_MIN_LEVEL 0 /* No level less than this */
#define MSEN_MAX_LEVEL 255 /* No level greater than this */
#define MSEN_MIN_CATEGORY 0 /* No category less than this */
#define MSEN_MAX_CATEGORY 65534 /* No category greater than this */
/*
* MSEN label type names. Choose an upper case ASCII character.
*/
#define MSEN_ADMIN_LABEL 'A' /* Admin: low < admin != tcsec < high */
#define MSEN_EQUAL_LABEL 'E' /* Wildcard - always equal */
#define MSEN_HIGH_LABEL 'H' /* System High - always dominates */
#define MSEN_MLD_HIGH_LABEL 'I' /* System High, multi-level dir */
#define MSEN_LOW_LABEL 'L' /* System Low - always dominated */
#define MSEN_MLD_LABEL 'M' /* TCSEC label on a multi-level dir */
#define MSEN_MLD_LOW_LABEL 'N' /* System Low, multi-level dir */
#define MSEN_TCSEC_LABEL 'T' /* TCSEC label */
#define MSEN_UNKNOWN_LABEL 'U' /* unknown label */
#define MSEN_EXACT_LABEL 'X' /* Exact match required for access */
/*
* Allow for 26 (a-z) MINT label types.
* Expanding this will require a bigger table in mac_dom.c
*/
#define MINT_MIN_LABEL_NAME 'a' /* No label name less than this */
#define MINT_MAX_LABEL_NAME 'z' /* No label name greater than this */
#define MINT_LABEL_NAME_COUNT 26 /* Number of label types */
#define MINT_MIN_GRADE 0 /* No grade less than this */
#define MINT_MAX_GRADE 255 /* No grade greater than this */
#define MINT_MIN_DIVISION 0 /* No division less than this */
#define MINT_MAX_DIVISION 65534 /* No division greater than this */
/*
* MINT label type names. Choose a lower case ASCII character.
*/
#define MINT_BIBA_LABEL 'b' /* Dual of a TCSEC label */
#define MINT_EQUAL_LABEL 'e' /* Wildcard - always equal */
#define MINT_HIGH_LABEL 'h' /* High Grade - always dominates */
#define MINT_LOW_LABEL 'l' /* Low Grade - always dominated */
/*
* Layout of a label.
*
* ml_list contains the list of categories (MSEN) followed by the list of
* divisions (MINT). This is actually a header for the data structure which
* will have an ml_list with more than one element.
*
* -------------------------------
* | ml_msen_type | ml_mint_type |
* -------------------------------
* | ml_level | ml_grade |
* -------------------------------
* | ml_catcount |
* -------------------------------
* | ml_divcount |
* -------------------------------
* | category 1 |
* | . . . |
* | category N | (where N = ml_catcount)
* -------------------------------
* | division 1 |
* | . . . |
* | division M | (where M = ml_divcount)
* -------------------------------
*/
#define MAC_MAX_SETS 250
typedef struct mac_label {
unsigned char ml_msen_type; /* MSEN label type */
unsigned char ml_mint_type; /* MINT label type */
unsigned char ml_level; /* Hierarchical level */
unsigned char ml_grade; /* Hierarchical grade */
unsigned short ml_catcount; /* Category count */
unsigned short ml_divcount; /* Division count */
/* Category set, then Division set */
unsigned short ml_list[MAC_MAX_SETS];
} mac_label;
/* function prototypes */
#ifdef _KERNEL
extern void getplabel( mac_label * );
extern void setplabel( mac_label * );
extern void getlabel( char *, mac_label * );
extern void setlabel( char *, mac_label * );
extern int mac_access( struct inode *, int );
extern mac_label * mac_copyin_label( mac_label * );
extern mac_label * mac_add_label( mac_label * );
extern int mac_inrange( mac_label *, mac_label *, mac_label * );
extern int mac_mint_equ( mac_label *, mac_label * );
extern int mac_cat_equ( mac_label *, mac_label * );
#else /* _KERNEL */
extern int getplabel( mac_label * );
extern int setplabel( mac_label * );
extern int getlabel( char *, mac_label * );
extern int setlabel( char *, mac_label * );
#endif /* _KERNEL */
extern int mac_dom( mac_label *, mac_label * );
extern int mac_equ( mac_label *, mac_label * );
extern int mac_is_moldy( mac_label * );
extern mac_label *mac_dup( mac_label * );
extern int mac_size( mac_label * );
extern mac_label *mac_demld( mac_label * );
extern mac_label *mac_set_moldy( mac_label * );
extern int mac_ltomld( mac_label *, char *, int );
extern char *mac_labeltostr( mac_label *, int );
extern mac_label *mac_strtolabel( const char * );
extern int mac_invalid( mac_label * );
extern char *mac_getname( int, int );
extern int mac_getvalue( int, char * );
extern char *mac_getlblname( char * );
extern char *mac_getlblcomp( char * );
extern int mac_same( mac_label *, mac_label * );
extern int mac_copy( mac_label *, mac_label * );
extern int mac_label_devs( char *, mac_label * );
#endif /* __MAC_LABEL_ */